1. Field of the Invention
The invention relates to a dynamic binary translator or virtual processor with which target binaries may be executed transparently on a host machine of a different computer architecture. The invention further relates to testing and debugging of dynamic binary translation.
2. Background Art
A dynamic binary translator is a virtual processor, implemented in software, that allows a target binary or executable file to be executed transparently on a host machine having a different computer architecture. In more detail, at run-time, the binary translator translates non-native code in the target binary into native code recognized by the host machine to produce the same program behavior as is generated when the target binary is executed on the target platform.
Dynamic binary translation allows the same software binaries to be executed on host machines having different computer architectures. For example, a binary for SPARC architecture may execute natively on a SPARC processor, and dynamic binary translation may be used to execute this same binary on a processor having a different architecture.
FIG. 1 illustrates a target binary 10 being executed by a target platform processor 12. That is, target binary 10 was compiled for execution on the target platform processor 12. As shown, native code 14 from target binary 10 is executed by the target platform processor 12. FIG. 2 illustrates the same target binary 10 being translated by a dynamic binary translator 20 for execution on processor 22 which has a different architecture than the target architecture for which target binary 10 was compiled. As shown in FIG. 2, the target binary 10 provides non-native code 24 that is translated by the dynamic binary translator 20, at run-time, into native code 26 for processor 22.
When implementing a dynamic binary translator, it is necessary to perform testing and debugging to assure that a program behaves the same way when executing on the target platform as when executing on a host machine of a different architecture that uses the dynamic binary translator at run-time. A commonly-used way to check for the correctness of program behavior is to match the outputs of running the same program on both the host and target machines. Unfortunately, having a matched output does not guarantee that dynamic translation is correct. An error can still exist without affecting the program output.
For the foregoing reasons, there is a desire to develop an improved approach to testing and debugging dynamic binary translation to ensure the preciseness of the translations and to allow debugging to pinpoint the cause when program errors occur.